import {
    setStore,
    getStore
} from '@/util/store'
import { validatenull } from "@/util/validate"
const dict= {
    state: {
        dicts: getStore({ name: 'dict' }) || {},
    },
    mutations: {
        FIND_DICTS: (state, dicts) => {        
            const result = {} 
            for (let i = 0; i < dicts.length; i++){
                if(state[i].label === dicts){
                    return i
                }
                // result[dicts[i]] = 1
            }      
            state.dicts = result 
            setStore({
                name:'dicts',
                content: state.dicts,
                type:'session'
            })
        }
    } 
}
export default dict
